package com.woniu.dao;

import com.woniu.pojo.Roles;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RolesMapper {
    int deleteByPrimaryKey(Integer roleId);

    int insert(Roles record);

    int insertSelective(Roles record);

    Roles selectByPrimaryKey(Integer roleId);

    int updateByPrimaryKeySelective(Roles record);

    int updateByPrimaryKey(Roles record);


    @Select("select * from pc_roles")
    List<Roles> selectAll();

    @Select("select * from pc_roles order by pc_roles.role_id desc")
    List<Roles> selectByPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);

    @Select("select * from pc_roles where role_name = #{roleName}")
    Roles selectRolesByName(String roleName);

    void saveRole(Roles roles);

    void batchDel(List<Integer> rolesId);
}